home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Tools & Apps / Misc. Utilities / Installer / Installer 3.2 / Samples - Installer 3.2 / CustomOrder.r < prev    next >
Encoding:
Text File  |  1992-01-22  |  6.1 KB  |  164 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2.  *
  3.  *    Apple Macintosh Developer Technical Support
  4.  *
  5.  *  Installer 3.2 sample: setting package order in Custom Installation 
  6.  *
  7.  *    File:        CustomOrder.r -    Rez Source
  8.  *
  9.  *    by:            Jon Zap
  10.  *
  11.  *    Copyright © 1991 Apple Computer, Inc.
  12.  *    All rights reserved.
  13.  *
  14.  *------------------------------------------------------------------------------
  15.  * This installation sample is intended to only demonstrate how to organize the
  16.  * entries in your Custom Installation screen.  All of the packages contain the
  17.  * same infa to simplify the script.  We are not recommending that you do this in
  18.  * a real script.  Points to notice:  the ordering is equivalent to the order
  19.  * in this file NOT on the resource ID number.  To look at it in another way, the
  20.  * ordering is the same as the REVERSE order that is seen when using resEdit.
  21.  * This example also demonstrates a divider package, which is used to provide
  22.  * you with the ability to group (or separate) packages in the list of packages
  23.  * on the custom installation screen.
  24.  *----------------------------------------------------------------------------*/
  25.  
  26. #include "InstallerTypes.r"
  27.  
  28. /* You can build and complete the script with the following lines:
  29. # Note: set up floppies with the appropriate names and contents before running scriptcheck
  30. # or set up folders with the same names and contents as the floppies
  31. # put these folders in the same folder as the script or at the root directory of same disk
  32.  
  33.     rez -o "CustomOrder" -t 'bjbc' -c 'bjbc' "CustomOrder.r"
  34.     setfile -a i "CustomOrder"        #mark Inited
  35.     scriptcheck -p "CustomOrder"
  36. */
  37.  
  38. /* put a 1 in the creation date field of source 'infs' to have ScriptCheck set date */
  39. #define kScriptCheckSetsDate    0x01
  40.  
  41. /* Definitions for the file spec atoms (specifications for source and destination files) */
  42. #define fsSourceProgram            2000
  43. #define fsTargetProgram            2001
  44.  
  45. /* This is the name of the source disk */
  46. #define ProgramDisk "Program Disk:"
  47.  
  48. /* This is the target path for where we want to install the file. */
  49. #define TargetPath    ":Installed Application:"
  50.  
  51. /* Definition for the package. */
  52. #define pkTheProgram1            3000
  53. #define pkTheProgram2            3001
  54. #define pkTheProgram3            3002
  55. #define pkTheProgram4            3003
  56. #define pkDivider1                1
  57.  
  58. /* Definition for the file atom */
  59. #define faProgram                4000
  60.  
  61. /***************************** Package Resources ************************************************/
  62. resource 'inpk' (pkTheProgram1) {
  63.     format0 {
  64.         showsOnCustom,             /* Package appears in the Custom Install display */
  65.         removable,                /* Package can be removed */
  66.         dontForceRestart,        /* installing an app doesnt require rebooting */
  67.         0,                         /* 'icmt' not required */
  68.         0,                        /* Package size (filled in by ScriptCheck) */
  69.         "First Package", {        /* package name */
  70.             'infa', faProgram;
  71.         }
  72.     }
  73. };
  74.  
  75. resource 'inpk' (pkTheProgram2) {
  76.     format0 {
  77.         showsOnCustom,             /* Package appears in the Custom Install display */
  78.         removable,                /* Package can be removed */
  79.         dontForceRestart,        /* installing an app doesnt require rebooting */
  80.         0,                         /* 'icmt' not required */
  81.         0,                        /* Package size (filled in by ScriptCheck) */
  82.         "Second Package", {        /* package name */
  83.             'infa', faProgram;
  84.         }
  85.     }
  86. };
  87.  
  88. resource 'inpk' (pkDivider1) {
  89.     format0 {
  90.         showsOnCustom,             /* Package appears in the Custom Install display */
  91.         notRemovable,            /* Package can't be removed */
  92.         dontForceRestart,        /* divider doesnt require rebooting */
  93.         0,                         /* 'icmt' not required */
  94.         0,                        /* Package size (filled in by ScriptCheck) */
  95.         "-", {'    ', 0 }        /* package name - divider */
  96.     }
  97. };
  98.  
  99. resource 'inpk' (pkTheProgram4) {
  100.     format0 {
  101.         showsOnCustom,             /* Package appears in the Custom Install display */
  102.         removable,                /* Package can be removed */
  103.         dontForceRestart,        /* installing an app doesnt require rebooting */
  104.         0,                         /* 'icmt' not required */
  105.         0,                        /* Package size (filled in by ScriptCheck) */
  106.         "First Additional Package", {        /* package name */
  107.             'infa', faProgram;
  108.         }
  109.     }
  110. };
  111. resource 'inpk' (pkTheProgram3) {
  112.     format0 {
  113.         showsOnCustom,             /* Package appears in the Custom Install display */
  114.         removable,                /* Package can be removed */
  115.         dontForceRestart,        /* installing an app doesnt require rebooting */
  116.         0,                         /* 'icmt' not required */
  117.         0,                        /* Package size (filled in by ScriptCheck) */
  118.         "Second Additional Package", {        /* package name */
  119.             'infa', faProgram;
  120.         }
  121.     }
  122. };
  123.  
  124. /********************************************* File Specs ***************************************/
  125. /* Source File Specs */
  126. resource 'infs' (fsSourceProgram) {
  127.     'APPL',                                /* File Type */
  128.     'Arfz',                                /* Creator */
  129.     kScriptCheckSetsDate,                /* ScriptCheck will fill in the creation date */
  130.     noSearchForFile,                    /* Do not search the source disk for the file */
  131.     typeCrMustMatch,                    /* file type and creator on this file must match */
  132.     ProgramDisk"TheProgram"                /* Path to the file */
  133. };
  134.  
  135. /* Target File Specs */
  136. resource 'infs' (fsTargetProgram) {
  137.     'APPL',                                /* File Type */
  138.     'Arfz',                                /* Creator */
  139.     0,                                    /* not needed for target file spec */
  140.     noSearchForFile,                    /* Do not search the target disk for the file */
  141.     typeCrMustMatch,                    /* not needed for target file specs */
  142.     TargetPath"TheProgram"                /* installation Path */
  143. };
  144.  
  145. /******************************************** File Atoms ************************************************/
  146. resource 'infa' (faProgram) {
  147.     format0 {
  148.         deleteWhenRemoving,                /* Delete the file if remove (option-custom) is clicked    */
  149.         dontDeleteWhenInstalling,         /* don't need to predelete the target before copying new one */
  150.         copy,                             /* Copy the file to the destination */
  151.         leaveAloneIfNewer,                 /* do not Install this version, if newer one exists */
  152.         updateExisting,                 /* replace an existing copy, if mine is newer */
  153.         copyIfNewOrUpdate,                /* Copy whether the target file exists or not */
  154.         rsrcFork, dataFork,                /* Copy both forks of the file */
  155.         fsTargetProgram,                /* TARGET file spec */
  156.         fsSourceProgram,                 /* SOURCE file spec */
  157.         0,                                /* atom size (filled in by ScriptCheck) */
  158.         ""                                /* Atom Description (for a file Installer will use file name) */
  159.     };
  160. };
  161.  
  162.  
  163.  
  164.